You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
485 B

import { requireAdmin } from "#server/utils/admin-guard";
import { getAgentToolById } from "#server/service/agent-tool";
export default defineWrappedResponseHandler(async (event) => {
await requireAdmin(event);
const id = getRouterParam(event, "id");
if (!id) {
return R.throwError(400, "无效的工具ID", null);
}
const result = await getAgentToolById(id);
if (!result) {
return R.throwError(404, "工具不存在", null);
}
return R.success(result);
});